package com.sky.common.track;

import com.sky.business.sys.domain.AlarmRecord;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 警报信息
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AlarmInfo {
    private String taskId;
    private String deviceId;
    private String className;
    private boolean auto;
    private Date beginTime;
    private Date endTime;


    /**
     * 生成报警记录
     * @return 报警记录
     */
    public AlarmRecord toAlarmRecord(){
        AlarmRecord alarmRecord = new AlarmRecord();
        alarmRecord.setTaskId(taskId);
        alarmRecord.setAuto(auto);
        alarmRecord.setClassName(className);
        alarmRecord.setBeginTime(beginTime);
        alarmRecord.setEndTime(endTime);
        return alarmRecord;
    }

}




